<html>

<head>
<meta charset="UTF-8">
<title>申请详情</title>
</head>
<body>
	<link rel="stylesheet" type="text/css" href="/css/form.css">
	<script type="text/javascript" src="/js/task.js"></script>
	<script type="text/javascript">
		$(".navigation span:first").text("我的任务");
	</script>
	<style>
		#object td:NTH-CHILD(odd){
			width:100px;
		    color: #827e7e;
		    text-align: center;
		   }
		#object td:NTH-CHILD(even),.process-update-table td:NTH-CHILD(even),.task-pizhu td:NTH-CHILD(even){
			 text-align: left;
		   } 
		.process-update-table td{
		   padding: 10px 0px 10px 0;  
		   }       
		.task-process-update{
		   	padding: 7px 15px;
		    background: #e84827;
		    border-radius: 4px;
		    color: white;
		}
		.process-table tr,.process-table td{
			border:none !important;
			text-align: left;
			padding: 5px !important;
		}
	</style>
	<#include "/head.ftl"/>
	<div class="process-update-table" style="display: none">
		<div style="border-bottom: 1px solid #cfc7c7">
			<div style="margin: 20px;">
				<table style="margin: 0 auto;width: 400px;">
					<tr>
						<td>任务反馈:</td>
						<td>
							<textarea class="tfContent" style="width: 100%; height: 100px;" ></textarea>
						</td>
					</tr>
					<tr>
						<td>任务状态:</td>
						<td>
							<select style="width: 86px;" class="status">
								<#list status['task_manage_status'] as taskstatus>
								<#if taskstatus.value!=1 && taskstatus.value!=5>
									<option value="${taskstatus.value}">${taskstatus.name}</option>
								</#if>
								</#list>
							</select>
						</td>
					</tr>
					<tr>
						<td>任务附件:</td>
						<td>
						<a class="uploadattch" style="font-size: 12px; color: #94754D;"><i class="iconfont icon-accessory"></i>附件上传</a>
						<input class="file" type="file" style="display:none"/>
						<span class="filename" style="margin-left: 10px;font-size: 12px;"></span>
						</td>
					</tr>
				</table>
			</div>
		</div>
	</div>
	<div class="task-pizhu" style="display: none">
		<div style="border-bottom: 1px solid #cfc7c7">
			<div style="margin: 20px;">
				<table style="margin: 0 auto;width: 400px;">
					<tr>
						<td>任务反馈:</td>
						<td>
							<textarea class="pizhuContent" style="width: 100%; height: 100px;" ></textarea>
						</td>
					</tr>
					<tr>
						<td>附件:</td>
						<td>
						<a class="uploadattch"  style="font-size: 12px; color: #94754D;"><i class="iconfont icon-accessory"></i>附件上传</a>
						<span class="filename" style="margin-left: 10px;font-size: 12px;"></span>
						</td>
					</tr>
				</table>
			</div>
		</div>
	</div>
	
	<div class="content">
		<div class="tab">
			<div class="tab-header">
				<a title="返回" class="btn btn-setting" onclick="back(this)"> <i
					class="iconfont icon-undo"></i>
				</a> <a title="刷新" class="btn btn-setting refresh-this" onclick="refresh(this)">
					<i class="iconfont icon-refresh"></i>
				</a>
			</div>
			<div class="apply-info">
			<#if task??>
				<div class="info-head">
					<table>
						<tr>
							<td style="text-align: left;">
								<h2 style="color: black; margin-bottom: 5px;">
									任务标题：${(task.tmTitle)!''}
									<#list status['apply'] as sa> <#if sa.value==1> <span
										class="label"></span> </#if></#list>
								</h2>
							</td>
							<td style="text-align: left;">任务类型：
							<#if task.type??>
								<#list status['task_manage_type'] as status>
									<#if status.value==task.type>
										<span class="btn" style="background: ${(status.color)!''}">${status.name}</span>	
									</#if>
								</#list>
							</#if>
							</td>
							<td style="text-align: left;">任务状态：
							<#if task.tmStatus??>
							<#list status['task_manage_status'] as status>
										<#if status.value==task.tmStatus>
										<span class="btn" style="background:${(status.color)!''}">${status.name}</span>
										</#if>
							</#list>
							</#if>
							</td>
							<td>发布人：<span style="color: black">${(task.user.realName)!''}</span></td>
							<td>发布时间：<span style="color: black">${(task.tmPushTime?string("yyyy-MM-dd"))!''}</span></td>
						</tr>
					</table>
				</div>
				<div class="info-content">
					<table id="object" style="margin: 10px auto;width: 600px">
						<tr>
							<td>任务内容:</td>
							<td>
							<div>${(task.tmContent)!''}</div>
							</td>
						</tr>
						<tr>
							<td>完成标准:</td>
							<td>${(task.finishrequre)!''}</td>
						</tr>
						<tr>
							<td>任务时间:</td>
							<td>${(task.tmStartTime?string("yyyy-MM-dd"))!''}---${(task.tmEndTime?string("yyyy-MM-dd"))!''}</td>
						</tr>
						<tr>
							<td>参与人员:</td>
							<td>
								<#if username??&&username!="">
									${username}
									<#else>
									无
								</#if>
							</td>
						</tr>
						<tr>
							<td>附件:</td>
							<td>
							<#if task??&&task.attid??>
								<a class="download"  attid="${task.attid}" style="font-size: 12px; color: #94754D;"><i class="iconfont icon-accessory"></i>附件下载</a>
							<#else>
								<a style="font-size: 12px; color: #94754D;">无</a>
							</#if>
							</td>
						</tr>
						<tr>
							<td>任务进度:</td>
							<td>
							<table class="process-table">
								<tr >
									<td><span>${(task.user.realName)!''}</span></td>
									<#if task.tmStatus!=5>
										<#list status['task_manage_status'] as status>
										
												<#if status.value==task.tmStatus>
													<td style="width: 80%"><div style="width:85%;height: 10px;border-radius: 3px;background: #c3c3c3;display: inline-block;">
														<div style="width: ${status.percent};background:#e64339;height: 10px;border-radius: 3px;"></div>
													</div>
													<span>${status.percent}</span></td>
												</#if>
											
										</#list>
										<#else>
											<td style="width: 80%"><div style="width:85%;height: 10px;border-radius: 3px;background: #c3c3c3;display: inline-block;">
														<div style="width:0;background:#e64339;height: 10px;border-radius: 3px;"></div>
													</div>
											<span>0%</span>
											</td>
									</#if>
								</tr>
								<#list task.taskuser as tulist>
									<tr>
										<td><span>${(tulist.user.realName)!''}</span></td>
										<#if tulist.tmStatus!=5>
										<#list status['task_manage_status'] as status>
											<#if status.value==tulist.tmStatus>
											<td style="width:80%"><div style="width:85%;height: 10px;border-radius: 3px;background: #c3c3c3;display: inline-block;">
												<div style="width:${status.percent};background:#e64339;height: 10px;border-radius: 3px;"></div>
											</div>
											<span>${status.percent}</span></td>
											</#if>
										</#list>
										<#else>
										<td style="width:80%"><div style="width:85%;height: 10px;border-radius: 3px;background: #c3c3c3;display: inline-block;">
												<div style="width:0;background:#e64339;height: 10px;border-radius: 3px;"></div>
											</div>
											<span>0%</span></td>
										</#if>
									</tr>
								</#list>
							</table>
							</td>
						</tr>
					</table>
					<div style="text-align: center;margin: 22px 0 12px 0;">
						<div>
						<#if task.tmStatus==4>
								<a class="task-process-update"  style="margin-right: 10px;">任务完成</a>
							<#elseif task.tmStatus==5>
								<a class="task-process-update"  style="margin-right: 10px;background: #a49592;">任务未完成</a>
							<#else>
								<a class="task-process-update process-update" status="${task.tmStatus}" taskid="${task.tmId}" style="margin-right: 10px;">进度修改</a>
								<a class="task-process-update process-update"  taskid="${task.tmId}" style="margin-left: 10px;background: #a49592">添加批注</a>
						</#if>
						</div>
					</div>
				</div>
				<div class="info-record">
					<h3 class="">
						<i class="iconfont icon-circle1"></i>任务反馈
					</h3>
					<#if task.tfback?size gt 0>
						<#list task.tfback?sort_by(['tfTime'])?reverse as tf>
							<div class="shape"></div>
							<div class="record-user">
								<h4>
								${tf.user.realName}
								</h4>
								<#if tf.status??>
									<span style="float:none">修改任务状态为
										<#list status['task_manage_status'] as status>
												<#if status.value==tf.status>
													${status.name}
												</#if>
										</#list>
									</span>
								</#if>
								<span>${tf.tfTime}</span>
							</div>
							<#if tf.user.photo??&&tf.user.photo!="">
								<img class="user-head" alt="用户头像" src="/file/image/${tf.user.photo}"
								width="25px" height="25px">
								<#else>
								<img class="user-head" alt="用户头像" src="/images/default-head.jpg"
								width="25px" height="25px">
							</#if>
							<div class="record-content">${tf.tfContent}
							<#if tf.attid??>
								<a class="download"  attid="${tf.attid}" style="font-size: 12px; color: #94754D;"><i class="iconfont icon-accessory"></i>附件下载</a>
							</#if>
							</div>
							<div class="shape"></div>
						</#list>
						<#else>
						<div style="margin-top: 10px;">暂时还未有人反馈!</div>
					</#if>
				</div>
				<#else>
					<div class="info-head">
						<table>
							<tr>
								<td style="text-align: left;">
									<h2 style="color: black; margin-bottom: 5px;">
										任务标题：${(tu.task.tmTitle)!''}
										<#list status['apply'] as sa> <#if sa.value==1> <span
											class="label"></span> </#if></#list>
									</h2>
								</td>
								<td style="text-align: left;">任务类型：
								<#if tu.task.type??>
									<#list status['task_manage_type'] as status>
										<#if status.value==tu.task.type>
										<span class="btn" style="background: ${(status.color)!''}">${status.name}</span>	
												
										</#if>
									</#list>
								</#if>
								</td>
								<td style="text-align: left;">任务状态：
								<#if tu.task.tmStatus??>
								<#list status['task_manage_status'] as status>
											<#if status.value==tu.tmStatus>
											<span class="btn" style="background: ${(status.color)!''}">${status.name}</span>	
											</#if>
								</#list>
								</#if>
								</td>
								<td>发布人：<span style="color: black">${(tu.task.user.realName)!''}</span></td>
								<td>发布时间：<span style="color: black">${(tu.task.tmPushTime?string("yyyy-MM-dd"))!''}</span></td>
							</tr>
						</table>
					</div>
					<div class="info-content">
						<table id="object" style="margin: 10px auto;width: 600px">
							<tr>
								<td>任务内容:</td>
								<td>
								<div>${(tu.task.tmContent)!''}</div>
								</td>
							</tr>
							<tr>
								<td>完成标准:</td>
								<td>${(tu.task.finishrequre)!''}</td>
							</tr>
							<tr>
								<td>任务时间:</td>
								<td>${(tu.task.tmStartTime?string("yyyy-MM-dd"))!''}---${(tu.task.tmEndTime?string("yyyy-MM-dd"))!''}</td>
							</tr>
							<tr>
								<td>参与人员:</td>
								<td>
									<#if username??&&username!="">
										${username}
										<#else>
										无
									</#if>
								</td>
							</tr>
							<tr>
								<td>附件:</td>
								<td>
								<#if tu??&&tu.task.attid??>
									<a class="download"  attid="${tu.task.attid}" style="font-size: 12px; color: #94754D;"><i class="iconfont icon-accessory"></i>附件下载</a>
								<#else>
									<a style="font-size: 12px; color: #94754D;">无</a>
								</#if>
								</td>
							</tr>
							<tr>
								<td>任务进度:</td>
								<td>
								<#list status['task_manage_status'] as status>
											<#if status.value==tu.tmStatus>
												<div style="width:92%;height: 10px;border-radius: 3px;background: #c3c3c3;display: inline-block;">
													<div style="width:${status.percent};background:#e64339;height: 10px;border-radius: 3px;"></div>
												</div>
												<span>${status.percent}</span>
											</#if>
								</#list>
								</td>
							</tr>
						</table>
						<div style="text-align: center;margin: 22px 0 12px 0;">
							<div>
								<#if tu.task.tmStatus==4>
									<a class="task-process-update"  style="margin-right: 10px;">任务完成</a>
								<#elseif tu.task.tmStatus==5>
									<a class="task-process-update"  style="margin-right: 10px;background: #a49592;">任务未完成</a>
								<#else>
									<a class="task-process-update process-update" type="mytask" status="${tu.task.tmStatus}" taskid="${tu.task.tmId}" style="margin-right: 10px;">进度修改</a>
									<a class="task-process-update process-update"  taskid="${tu.task.tmId}" style="margin-left: 10px;background: #a49592">添加批注</a>
								</#if>
							</div>
						</div>
					</div>
					
					<div class="info-record">
						<h3 class="">
							<i class="iconfont icon-circle1"></i>任务反馈
						</h3>
						<#if tu.task.tfback?size gt 0>
							<#list tu.task.tfback?sort_by(['tfTime'])?reverse as tf>
								<div class="shape"></div>
								<div class="record-user">
									<h4>${tf.user.realName}</h4>
									<#if tf.status??>
										<span style="float:none">修改任务状态为
											<#list status['task_manage_status'] as status>
													<#if status.value== tf.status>
														${status.name}
													</#if>
											</#list>
										</span>
									</#if>
									<span>${tf.tfTime}</span>
								</div>
								<#if tf.user.photo??&&tf.user.photo!="">
									<img class="user-head" alt="用户头像" src="/file/image/${tf.user.photo}"
									width="25px" height="25px">
									<#else>
									<img class="user-head" alt="用户头像" src="/images/default-head.jpg"
									width="25px" height="25px">
								</#if>
								<div class="record-content">${tf.tfContent}
								<#if tf.attid??>
									<a class="download" type="" attid="${tf.attid}" style="font-size: 12px; color: #94754D;"><i class="iconfont icon-accessory"></i>附件下载</a>
								</#if>
								</div>
								<div class="shape"></div>
							</#list>
						<#else>
							<div style="margin-top: 10px;">暂时还未有人反馈!</div>
						</#if>
					</div>
				</#if>
				
			</div>
		</div>

	</div>
</body>
</html>